<template>
  <div style="padding: 10px 20px 20px;text-align: left;">
    <p style="display: flex;justify-content: space-between;"><span>工单预警</span></p>
    <dv-scroll-ranking-board :key="value" :config="config" style="width:400px;height:200px" />
  </div>
</template>

<script>
import { WorkOrderAlertResult } from '@/api/modular/main/bigScreen/bigScreenManage'
const data = [
    {
      name: '周口',
      value: 55
    },
    {
      name: '南阳',
      value: 120
    },
    {
      name: '西峡',
      value: 78
    },
    {
      name: '驻马店',
      value: 66
    },
    {
      name: '新乡',
      value: 80
    },
    {
      name: '信阳',
      value: 45
    },
    {
      name: '漯河',
      value: 29
    }
  ]
  export default {
    data() {
      return {
        config: {
          data: data,
          waitTime: 1200,
          unit: '天',
          rowNum: 4
        },
        value: 0
      }
    },
    created() {
      WorkOrderAlertResult().then((res) => {
        this.config.data = Array.from(res.data, item => { return { name: item.name, value: Math.abs(item.surplusTime) } })
        this.value++
      })
    }
  }
</script>
